package com.itheima.app.interceptor;

import com.itheima.domain.db.User;

public class UserHolder {
    private static final ThreadLocal<User> USERTL = new ThreadLocal<>();

    //绑定用户
    public static void set(User user){
        USERTL.set(user);
    }

    //获取用户
    public static User get(){
        return USERTL.get();
    }

    //解绑用户
    public static void remove(){
        USERTL.remove();
    }
}
